<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:sec="http://www.springframework.org/security/facelets/tags"
				template="/WEB-INF/layouts/template.xhtml">

<ui:define name="main">
<script type="text/javascript">document.getElementById('menuClients').className="selected";</script>
<div id="main">
	<div id="wrapper" class="yui-b">
		<h3 class="title">
			<h:outputText value="${msg.title_client_edit} ${client.name}" rendered="${!(client.id eq 0)}"/>
			<h:outputText value="${msg.title_client_add}" rendered="${client.id eq 0}"/>
		</h3>
		<ui:fragment id="messages">
			<div id="messagesInsertionPoint">
				<h:messages errorClass="errors" />
			</div>
		</ui:fragment>
		<div class="wrapper">
			<h:form id="client">
				<div class="yui-gd">
					<div class="yui-u first">
						<h3>${msg.client}</h3>
						<div class="field">
							<div class="label">
								<h:outputLabel for="name">${msg.name}</h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="name" value="${client.name}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="email">${msg.email} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="email" value="${client.email}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="url">${msg.url} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="url" value="${client.url}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="street">${msg.street} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="street" value="${client.address.street}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="number">${msg.number} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="number" value="${client.address.number}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="city">${msg.city} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="city" value="${client.address.city}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="zipcode">${msg.zipcode} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="zipcode" value="${client.address.zipcode}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="country">${msg.country} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="country" value="${client.address.country}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="phone">${msg.phone} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="phone" value="${client.phone}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="fax">${msg.fax} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="fax" value="${client.fax}"/>
							</div>
						</div>
					</div>
					
					<div class="yui-u">
						<h3>${msg.contact}</h3>
			
						<div class="field">
							<div class="label">
								<h:outputLabel for="cname">${msg.name} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="cname" value="${client.contact.name}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="cemail">${msg.email} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="cemail" value="${client.contact.email}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="cmobile">${msg.mobile} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="cmobile" value="${client.contact.mobile}"/>
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="cphone">${msg.phone} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="cphone" value="${client.contact.phone}" />
							</div>
						</div>
						<div class="field">
							<div class="label">
								<h:outputLabel for="cfax">${msg.fax} </h:outputLabel>
							</div>
							<div class="input">
								<h:inputText id="cfax" value="${client.contact.fax}"/>
							</div>
						</div>
					</div>
				</div>
				<div style="clear: both; height: 5px;" />
				<div>
					<sf:commandLink id="save" action="save" processIds="*" rendered="${!(client.id eq 0)}"><div class="button">${msg.save}</div></sf:commandLink>
					<sf:commandLink id="create" action="create" processIds="*" rendered="${client.id eq 0}"><div class="button">${msg.create} ${msg.client}</div></sf:commandLink>
				</div>
				<div style="clear: both; height: 5px;" />
			</h:form>
		</div>
	</div>
</div>
<div style="clear: both; height: 5px;" />
<div>
	<h:form>
		<sf:commandLink id="back" action="back"  rendered="${!(client.id eq 0)}"><div class="button">${msg.back} ${msg.member}</div></sf:commandLink>
		<sf:commandLink id="cancel"  action="cancel" rendered="${client.id eq 0}"><div class="button">${msg.cancel}</div></sf:commandLink>
	</h:form>
</div>
</ui:define>
</ui:composition>